﻿
var ctefSchoolMap = ctefSchoolMap || {
    load: function (schools, pushpinIconPath) {
        map = new VEMap('myMap');
        map.LoadMap();
        map.SetCenterAndZoom(new VELatLong(25.656305, 108.831511), 4);
        this._addPushpins(map, schools, pushpinIconPath);
    },
    _addPushpins: function (map, schools, pushpinIconPath) {
        for (var i = 0; i < schools.length; i++) {
            var pushpin = new VEShape(VEShapeType.Pushpin, new VELatLong(schools[i].lon, schools[i].lat));
            pushpin.SetTitle(schools[i].name);
            pushpin.SetDescription(schools[i].intro);
            pushpin.SetCustomIcon(pushpinIconPath);
            map.AddShape(pushpin);
        }
    }
};
